// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   XzUsersDao.java

package net.sky.oaxz.dao;

import java.sql.*;
import net.sky.oaxz.bean.XzUser;


public class XzUsersDao extends BaseDao{

	private Connection conn = null;
	private PreparedStatement pstmt = null;
	private ResultSet rs = null;

	/**
	 * 
	 * @param 按userID查询
	 * @return 员工对象
	 */
	public XzUser searchById(int userId){
		XzUser user =null;
		StringBuffer sql=new StringBuffer("select e.id,e.name,e.loginname from sys_employee e where e.id = "+userId);
		try{
			conn=this.getConn();
			pstmt=conn.prepareStatement(sql.toString());
			rs=pstmt.executeQuery();
			while(rs.next()){
			    user = new XzUser();
                user.setId(rs.getInt("id"));
                user.setName(rs.getString("name"));
                user.setLoginName(rs.getString("loginname"));
			}
		}catch(Exception e){
			e.printStackTrace();
		}finally{
			this.closeAll(conn, pstmt, rs);
		}
		return user;
	}
	
	public int find(){
		return 12;
	}
	
}
